import {
    CALC_INCREASE,
    CALC_REDUCE,
} from './actions'

export default function calcReducer (state = {value: 0}, action) {
    switch(action.type) {
        case CALC_INCREASE: 
            return {...state, value: state.value + 1};
        case CALC_REDUCE:
            return {...state, value: state.value - 1};
        default: 
            return state
    }
}